package cn.wen.yinxiu.common.convention.result;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @ClassName: ResultEntity
 * @Author: 小飞
 * @Date: 2023/5/22 0:08
 * @Description: 返回值类型
 */
@Data
@Accessors(chain = true)
public class ResultEntity<T> implements Serializable {



    private static final long serialVersionUID = 5679018624309023727L;

    /**
     * 正确返回码
     */
    public static final Integer SUCCESS_CODE = 200;

    /**
     * 返回码
     */
    private Integer code;

    /**
     * 返回消息
     */
    private String message;

    /**
     * 响应数据
     */
    private T data;

    /**
     * 请求ID
     */
    private String requestId;

    public boolean isSuccess() {
        return SUCCESS_CODE == code;
    }
}

